import random
S = 1e6
N = 0
for i in range(int(S)):
    x = random.random()
    y = random.random()
    d = (x-0.5)**2+(y-0.5)**2
    if d<=0.5**2:
        N+=1
    else:
        pass
PI = 4*N/S
print('圆周率： %.6f' % PI)